#例子8-1:物体冷却模型

import numpy as np
import matplotlib.pyplot as plt

fig=plt.Figure()
ax=fig.add_subplot(111)
t=np.linspace(0,100,101)
k=np.log(2)/20
u=20+80*np.exp(-k*t)
u0=np.zeros_like(t)+20
ax.plot(t,u,'b-',t,u0,'b--')
ax.axis([0,100,0,120])
ax.plot([0,20,60],[100,60,30],'ro')
ax.set_xlabel('t = time')
ax.set_ylabel('u = temperature')
fig.savefig('mme2024-example-8-1.png')

